package cn.wusifx.zabbix.request.builder.item;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/itemprototype/create
 */
public class ItemPrototypeCreateRequestBuilder extends CreateRequestBuilder {
    private String name;
    private String key;
    private String hostId;
    private String ruleId;
    private Integer type;
    private Integer valueType;
    private String interfaceId;
    private String delay;
    public ItemPrototypeCreateRequestBuilder(String auth) {
        super("itemprototype.create", auth);
    }

    public ItemPrototypeCreateRequestBuilder(Long id, String auth) {
        super("itemprototype.create", id, auth);
    }

    public String getName() {
        return name;
    }

    public ItemPrototypeCreateRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public String getKey() {
        return key;
    }

    public ItemPrototypeCreateRequestBuilder setKey(String key) {
        this.key = key;
        return this;
    }

    public String getHostId() {
        return hostId;
    }

    public ItemPrototypeCreateRequestBuilder setHostId(String hostId) {
        this.hostId = hostId;
        return this;
    }

    public String getRuleId() {
        return ruleId;
    }

    public ItemPrototypeCreateRequestBuilder setRuleId(String ruleId) {
        this.ruleId = ruleId;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public ItemPrototypeCreateRequestBuilder setType(Integer type) {
        this.type = type;
        return this;
    }

    public Integer getValueType() {
        return valueType;
    }

    public ItemPrototypeCreateRequestBuilder setValueType(Integer valueType) {
        this.valueType = valueType;
        return this;
    }

    public String getInterfaceId() {
        return interfaceId;
    }

    public ItemPrototypeCreateRequestBuilder setInterfaceId(String interfaceId) {
        this.interfaceId = interfaceId;
        return this;
    }

    public String getDelay() {
        return delay;
    }

    public ItemPrototypeCreateRequestBuilder setDelay(String delay) {
        this.delay = delay;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("name",name);
        baseRequest.getParams().put("key_",key);
        baseRequest.getParams().put("hostid",hostId);
        baseRequest.getParams().put("ruleid",ruleId);
        baseRequest.getParams().put("type",type);
        baseRequest.getParams().put("value_type",valueType);
        baseRequest.getParams().put("interfaceid",interfaceId);
        baseRequest.getParams().put("delay",delay);
        return baseRequest;
    }
}
